<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>猜拳游戏</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    <style>
        /* 整体页面的通用样式 */
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4; /* 页面背景色 */
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 100vh; /* 确保页面至少占满视口高度 */
            margin: 0; /* 去除默认外边距 */
            padding: 0; /* 去除默认内边距 */
        }

        /* 标题样式 */
        h1 {
            color: #333; /* 标题文字颜色 */
        }

        /* 按钮样式 */
        button {
            border: none;
            background-color: transparent;
            margin: 15px;
            cursor: pointer;
            transition: transform 0.2s ease; /* 添加过渡效果，让按钮点击时有动画 */
        }

        button:hover {
            transform: scale(1.1); /* 鼠标悬停时按钮放大一点 */
        }

        button i {
            font-size: 80px; /* 图标大小 */
            color: #333; /* 图标颜色 */
        }

        /* 结果展示区域样式 */
        #result {
            margin-top: 20px;
            font-size: 18px;
            color: #555; /* 结果文字颜色 */
        }
        .gao {
            width: 100%;
            height: 100px;
            background-color: aquamarine;
            color: pink;
            font-size: 20px;
            font-weight: 800;
            text-align: center;
            line-height: 100px;
            margin: 0 auto;
        }
    </style>
</head>
<body>
    <h1>猜拳游戏</h1>
    <div class="choices">
        <!-- 石头按钮及对应的图标 -->
        <button onclick="play('石头')">
            <i class="fas fa-hand-rock"></i>
        </button>
        <!-- 剪刀按钮及对应的图标 -->
        <button onclick="play('剪刀')">
            <i class="fas fa-hand-scissors"></i>
        </button>
        <!-- 布按钮及对应的图标 -->
        <button onclick="play('布')">
            <i class="fas fa-hand-paper"></i>
        </button>
    </div>
    <h2 id="result"></h2>
    <div class="gao">
        我叫刘艳琪，我是哥够吧，我很听话哦，么么哒~都来关爱我吧
    </div>

    <script>
        function play(userChoice) {
            const choices = ['石头', '剪刀', '布'];
            const computerChoice = choices[Math.floor(Math.random() * choices.length)];
            let result;

            if (userChoice === computerChoice) {
                result = '平局！';
            } else if (
                (userChoice === '石头' && computerChoice === '剪刀') ||
                (userChoice === '剪刀' && computerChoice === '布') ||
                (userChoice === '布' && computerChoice === '石头')
            ) {
                result = '你赢了！';
            } else {
                result = '你输了！';
            }

            document.getElementById('result').innerText = `你选择了: ${userChoice}，计算机选择了: ${computerChoice}。${result}`;
        }
    </script>
</body>
</html>
